home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-11
/
shelp50a.zip
/
HELPLIB.PRG
< prev
next >
Wrap
Text File
|
1991-08-11
|
8KB
|
225 lines
FUNCTION DSPHELP
SETHELP()
SCROLLHLP()
RETURN NIL
FUNCTION SETHELP
IF ISCOLOR()
SETCOLOR(cWinColor)
ELSE
SETCOLOR("N/W")
ENDIF
* SADJPOS() will automatically correct windows that were created for 43+ Line
* mode but is running in 25 line mode
* When Auto Ajusting Window - (.T.) Displays Msg / (.F.) No Msg Displayed
SADJPOS(.F.)
************************************************************************
* All SPECIAL EFFECTS may be called by your programs & functions
* Syntax for all boxes are as follows
* nTopRow - Top Row
* nLeftCol - Left Column
* nBotRow - Bottom Row
* nRightCol - Right Column
* cFrame - Frame Style
* lIplode - Logical to Implode box on Exit
* cFramColor - Color String of Frame
* cWinColor - Color String of Window
* cShadType - "R" or "S" for Shadow Position
* TranShad - Logical to Make Transparent Shadow or Regular Shadow
* nShadClrf - Numeric Foreground Shadow Color (Transparent Only)
* nShadClrb - Numeric Background Shadow Color (Transparent Only)
* Important *
* To implode a box, you must first create one of the SPECIAL EFFECTS
* boxes with the lIplode switch as a logical True. The Implode Box
* must be called separately with the Return Value.
************************************************************************
DO CASE
CASE nBoxMethod == 1
@ nTopRow,nLeftCol CLEAR TO nBotRow,nRightCol
SETCOLOR(cFramColor)
@ nTopRow,nLeftCol,nBotRow,nRightCol BOX cFrame
SShadows(nTopRow,nLeftCol,nBotRow,nRightCol,cShadType,.T.,nShadclrf,nShadclrb)
CASE nBoxMethod == 2
nNoFrames:=SXPLODEBX(nTopRow,nLeftCol,nBotRow,nRightCol,cFrame,lIplode,cFramColor,cWinColor,cShadType,.T.,nShadClrf,nShadClrb)
CASE nBoxMethod == 3
nNoFrames:=SDROPBX(nTopRow,nLeftCol,nBotRow,nRightCol,cFrame,lIplode,cFramColor,cWinColor,cShadType,.T.,nShadClrf,nShadClrb)
CASE nBoxMethod == 4
nNoFrames:=SPOPBX(nTopRow,nLeftCol,nBotRow,nRightCol,cFrame,lIplode,cFramColor,cWinColor,cShadType,.T.,nShadClrf,nShadClrb)
CASE nBoxMethod == 5
nNoFrames:=SUPDWBX(nTopRow,nLeftCol,nBotRow,nRightCol,cFrame,lIplode,cFramColor,cWinColor,cShadType,.T.,nShadClrf,nShadClrb)
CASE nBoxMethod == 6
nNoFrames:=SCURTBX(nTopRow,nLeftCol,nBotRow,nRightCol,cFrame,lIplode,cFramColor,cWinColor,cShadType,.T.,nShadClrf,nShadClrb)
CASE nBoxMethod == 7
nNoFrames:=SLEFTBX(nTopRow,nLeftCol,nBotRow,nRightCol,cFrame,lIplode,cFramColor,cWinColor,cShadType,.T.,nShadClrf,nShadClrb)
CASE nBoxMethod == 8
nNoFrames:=SRIGHTBX(nTopRow,nLeftCol,nBotRow,nRightCol,cFrame,lIplode,cFramColor,cWinColor,cShadType,.T.,nShadClrf,nShadClrb)
OTHERWISE
nNoFrames:=SXPLODEBX(nTopRow,nLeftCol,nBotRow,nRightCol,cFrame,lIplode,cFramColor,cWinColor,cShadType,.T.,nShadClrf,nShadClrb)
ENDCASE
SETCOLOR(cFramColor)
DO CASE
CASE nWinType == 1
@nTopRow,nHeadcol-1 SAY SUBSTR(cMidBar,2,1)
@nTopRow,nHeadcol+LEN(TRIM(cHeader)) SAY SUBSTR(cMidBar,1,1)
CASE nWinType == 2
@nTopRow+2,nLeftCol SAY REPLICATE(SUBSTR(cFrame,2,1),nRightCol-nLeftCol)
@nTopRow+2,nLeftCol SAY SUBSTR(cMidBar,1,1)
@nTopRow+2,nRightCol SAY SUBSTR(cMidBar,2,1)
ENDCASE
DO CASE
CASE nFootType == 1
@nBotRow,nFootcol-1 SAY SUBSTR(cMidBar,2,1)
@nBotRow,nFootcol+LEN(TRIM(cFooter)) SAY SUBSTR(cMidBar,1,1)
CASE nFootType == 2
@nBotRow-2,nLeftCol SAY REPLICATE(SUBSTR(cFrame,2,1),nRightCol-nLeftCol)
@nBotRow-2,nLeftCol SAY SUBSTR(cMidBar,1,1)
@nBotRow-2,nRightCol SAY SUBSTR(cMidBar,2,1)
ENDCASE
SETCOLOR(cWinColor)
IF lEditRef
@ MaxRow(),0 SAY SPACE(MaxCol())
IF lEditRef
@ MaxRow(),(MaxCol()/2)-8 SAY 'F5 - Modify Help'
ENDIF
ENDIF
IF !EMPTY(cHeader)
SETCOLOR(cHeadColor)
IF nWinType == 1
@ nTopRow, nHeadcol SAY TRIM(cHeader)
ELSE
cTrimHdr := TRIM(cHeader)
@ nTopRow+1, nLeftCol+1 SAY SPACE(nHeadcol-nLeftCol)+cTrimHdr+SPACE((nRightCol-1-nHeadcol)-LEN(cTrimHdr))
ENDIF
ENDIF
IF !EMPTY(cFooter)
SETCOLOR(cFootColor)
IF nFootType == 1
@ nBotRow, nFootcol SAY TRIM(cFooter)
ELSE
cTrimFoot := TRIM(cFooter)
@ nBotRow-1, nLeftCol+1 SAY SPACE(nFootcol-nLeftCol)+cTrimFoot+SPACE((nRightCol-1-nFootcol)-LEN(cTrimFoot))
ENDIF
SETCOLOR(cWinColor)
ENDIF
RETURN NIL
FUNCTION SCROLLHLP
PRIVATE nBarTop,nBarBot,cBarChar,nPrevBar
SET CURSOR OFF
cBarChar := "░"
lOutLoop := .T.
nText_Cnt := 0
cSetUdf := 'P'
SUDFPBAR()
DO WHILE lOutLoop
SCROLLUDF()
DO WHILE .T.
INKEY(0)
DO CASE
CASE LASTKEY() == 5 .AND. !lTopPage
SDYNALINE(-1*nMWidth)
cSetUdf := 'U'
EXIT
CASE LASTKEY() == 24 .AND. !lBotPage
SDYNALINE(nMWidth)
cSetUdf := 'D'
EXIT
CASE LASTKEY() == 18 .AND. !lTopPage
SDYNAPAGE(-1*(nReadSize))
cSetUdf := 'P'
lBotPage := .F.
EXIT
CASE LASTKEY() == 3 .AND. !lBotPage
SDYNAPAGE(nReadSize)
cSetUdf := 'P'
lTopPage := .F.
EXIT
CASE LASTKEY() == -4 .AND. lEditRef
SUDFMENU()
SETHELP()
SUDFPBAR()
EXIT
CASE LASTKEY() == 27
lOutLoop := .F.
EXIT
ENDCASE
ENDDO
ENDDO
SET CURSOR ON
IF nBoxMethod > 1 .and. lIplode
IPLODEBX(nNoFrames)
RELEASE aIplodeScr
ENDIF
RETURN NIL
FUNCTION SUDFPBAR
nPrevBar := 0
nBarTop := IIF(nWinType==1,nTopRow+2,nTopRow+3)
nBarBot := IIF(nFootType==1,nBotRow-2,nBotRow-3)
SETCOLOR('W+/N')
FOR nBarcnt := nBarTop TO nBarBot
@ nBarcnt, nRightCol SAY cBarChar
NEXT
SETCOLOR(cWinColor)
RETURN NIL
FUNCTION SCROLLUDF
LOCAL nCurLine,nScrnSize,nStartRow,nBarLines,nBarPct,nBarPos,cHeadBar,cFootBar
cHeadBar := IIF(nWinType==1,SUBSTR(cFrame,8,1),SUBSTR(cMidBar,2,1))
cFootBar := IIF(nFootType==1,SUBSTR(cFrame,8,1),SUBSTR(cMidBar,2,1))
nScrnSize := (nBotRow-IIF(nFootType==1,0,2)) - (nTopRow+IIF(nWinType==1,1,3))
nStartRow := nTopRow+IIF(nWinType==1,1,3)
nText_Cnt := 0
nLines := 0
DO CASE
CASE cSetUdf == 'P'
@ nTopRow+IIF(nWinType==1,1,3),nLeftCol+1 CLEAR TO nBotRow-IIF(nFootType==1,1,3),nRightCol-1
FOR nCurLine := nStartRow TO nStartRow+nScrnSize
IF nText_Cnt < nLineSize
nText_Cnt := nText_Cnt + 1
nLines := nLines + 1
IF lXplodeTxt
XPLODEHLP(aHelpLine[nText_Cnt],nCurLine,(nLeftCol+((nRightCol-nLeftCol)/2))+nHlpSpacer)
ELSE
@ nCurLine,nLeftCol+1 SAY aHelpLine[nText_Cnt]
ENDIF
ENDIF
NEXT
CASE cSetUdf == 'U'
SCROLL(nTopRow+IIF(nWinType==1,1,3),nLeftCol+1,nBotRow-IIF(nFootType==1,1,3),nRightCol-1,-1)
@ nTopRow+IIF(nWinType==1,1,3),nLeftCol+1 SAY aHelpLine[1]
CASE cSetUdf == 'D'
SCROLL(nTopRow+IIF(nWinType==1,1,3),nLeftCol+1,nBotRow-IIF(nFootType==1,1,3),nRightCol-1,1)
@ nBotRow-IIF(nFootType==1,1,3),nLeftCol+1 SAY aHelpLine[1]
ENDCASE
nBarlines := nBarBot-nBarTop
nBarPct := nByteRead/nTxtSize
nBarPos := nBarTop+ROUND(nBarLines*nBarPct,1)
SETCOLOR('W+/N')
IF nPrevBar > 0
@ nPrevBar, nRightCol SAY cBarChar
ENDIF
@ IIF(lTopPage,nBarTop,IIF(lBotPage,nBarBot,nBarPos)), nRightCol SAY '▓'
nPrevBar := IIF(lTopPage,nBarTop,IIF(lBotPage,nBarBot,nBarPos))
IF !lBotPage
@ nBotRow-2,nRightCol SAY CHR(25)
ELSE
SETCOLOR(cFramColor)
@ nBotRow-2,nRightCol SAY cFootBar
ENDIF
SETCOLOR('W+/N')
IF !lTopPage
@ nTopRow+2,nRightCol SAY CHR(24)
ELSE
SETCOLOR(cFramColor)
@ nTopRow+2,nRightCol SAY cHeadBar
ENDIF
SETCOLOR(cWinColor)
RETURN NIL